# -*- coding: utf-8 -*-
# atlas_config.py
import os
from rich.theme import Theme

# 允许的执行模式
SAFE_MODES = ["SAFE", "RELAXED", "UNSAFE"]

# Rich 主题（供 CLI 复用）
THEME = Theme({
    "primary": "bold cyan",
    "accent": "magenta",
    "good": "bold green",
    "warn": "bold yellow",
    "bad": "bold red",
    "muted": "grey62",
})

# 默认配置（可被环境变量覆盖；再被 .atlasplit_cli.json 覆盖）
DEFAULTS = {
    "base_url": os.getenv("OPENAI_BASE_URL") or "https://api.deepseek.com/v1",
    "api_key": os.getenv("OPENAI_API_KEY") or "sk-20c5af730ab8454b8dcd4220b419cfe6",
    "model":   os.getenv("LLM_MODEL")       or "deepseek-coder",
    # 你前面加过的两个默认项，也一起放进来
    "mode_default": "SAFE",
    "ops_auto_apply_mkdir": True,
    "quick_task_default": os.getenv("ATLAS_QUICK_TASK") or
        "统计每人退货数量与金额；将订单总额按人数等额分摊，保留两位并末位纠偏；输出 Person, Items, ShareAmount 至 Result。"
}

# 任务模板
TASK_TEMPLATES = {
    "Equal split (basic)": (
        "On sheet 'Returns', compute return count and total amount per person; "
        "equally split the order total across participants, keep 2 decimals and fix the last cent; "
        "output columns: Person, Items, ShareAmount to Result."
    ),
    "Weighted split": (
        "On sheet 'Weights', split Total according to Weight, keep 2 decimals and ensure sums match; "
        "output Person, Weight, Share to Result."
    ),
    "Cap & Floor": (
        "Equally split by participants; apply per-person cap 300 and floor 20; "
        "distribute rounding residual on the last row; output Person, ShareAmount to Result."
    ),
    "Multi-sheet aggregate": (
        "Aggregate across sheets 'Header' and 'Lines' by OrderId, sum Amount, then split equally per Person; "
        "keep 2 decimals and ensure sum equals original; output Person, OrderId, ShareAmount to Result."
    ),
    "Custom": ""
}
